{$R-}

(*
	GetCreator -- map OSType to creator name

	pascal GetCreator.p
	asm GetCreator.a
	link -m ENTRYPOINT -o {BOOT}docs -rt XFCN=1 -sn Main=GetCreator ¶
	  GetCreator.p.o  GetCreator.a.o ¶
	  {MPW}Libraries:Interface.o 
        {boot}hypercard

	
*)

{$S GetCreator } 	{ Segment name must be the same as the command name. }

UNIT DummyUnit;

INTERFACE

USES MemTypes, QuickDraw, OSIntf, HyperXCmd;

PROCEDURE EntryPoint(paramPtr: XCmdPtr);
	
IMPLEMENTATION

TYPE Str31 = String[31];

PROCEDURE GetCreator(paramPtr: XCmdPtr); 							FORWARD;
FUNCTION  ScanDeskTop(creator: OSType; VAR appVol: INTEGER; 
                      VAR appDir: LongInt; VAR appName: Str255): BOOLEAN;			EXTERNAL;

  PROCEDURE EntryPoint(paramPtr: XCmdPtr);
  BEGIN
    GetCreator(paramPtr);
  END;

  PROCEDURE GetCreator(paramPtr: XCmdPtr);
  VAR creator: OSType;
      appName: Str255;
      appVol:  INTEGER;
      appDir:  LongInt;
  {$I XCmdGlue.inc }
  BEGIN
    WITH paramPtr^ DO
      BEGIN
        IF paramCount < 1 THEN EXIT(GetCreator);
	BlockMove(params[1]^,@creator,4);
        IF ScanDeskTop(creator,appVol,appDir,appName) 
	THEN returnValue := PasToZero(appName);
      END;
  END;

END.



